$border-radius: 4px;

html.dark {
  .segmented {
    background-color: #262727;
  }
}

.segmented {
  background-color: rgba(0, 0, 0, 0.04);
  padding: 2px;
  font-size: $font-size-medium;
  border-radius: $border-radius;
  &-block {
    display: flex;
    width: 100%;
    .segmented-item {
      flex: 1;
      min-width: 0;
    }
  }
  &-group {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-items: flex-start;
    width: 100%;
  }
  &-item {
    display: inline-flex;
    align-items: center;
    position: relative;
    text-align: center;
    cursor: pointer;
    border-radius: var(--el-border-radius-base);
    transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
    padding: 5px $space-small-s;
    justify-content: center;
    font-size: $font-size-medium;
    &:hover {
      background-color: rgba(0, 0, 0, 0.06);
    }
  }
  &-item-active {
    color: var(--el-color-white);
  }
  &-item-bar {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    display: none;
    width: 0;
    height: 100%;
    padding: 4px 0;
    background-color: var(--el-color-primary);
    border-radius: $border-radius;
    box-shadow:
      0 2px 8px -2px rgb(0 0 0 / 5%),
      0 1px 4px -1px rgb(0 0 0 / 7%),
      0 0 1px rgb(0 0 0 / 7%);
    transition:
      transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1),
      width 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
    will-change: transform, width;
  }
  &-item-disabled {
    cursor: not-allowed;
    color: rgba(0, 0, 0, 0.25);
    &:hover {
      background-color: transparent;
    }
  }
  .segmented-item-active.segmented-item-disabled {
    color: var(--el-color-white);
  }
  &-item-icon {
    margin-top: 2px;
  }
}

/* large */
.segmented-large {
  .segmented-item {
    padding: 8px $space-small;
    font-size: $font-size-medium-x;
  }
}

/* small */
.segmented-small {
  .segmented-item {
    padding: 2px 3px;
    font-size: $font-size-small;
  }
}